package com.jichangxiu.system.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jichangxiu.common.entity.po.BaseEntity;
import com.jichangxiu.system.entity.bo.SysSourceBo;
import com.jichangxiu.system.entity.vo.SysSourceVo;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMappers;
import lombok.*;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;

/**
 * SysSource: sys_source 系统数据源表
 *
 * @author JiChangXiu
 * @create 2024-06-28 13:44:46
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("sys_source")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@AutoMappers({
        @AutoMapper(target = SysSourceBo.class, reverseConvertGenerate = false),
        @AutoMapper(target = SysSourceVo.class, reverseConvertGenerate = false)
})
public class SysSource extends BaseEntity {

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 编码
     */
    @TableField(value = "no")
    private String no;

    /**
     * 标识
     */
    @TableField(value = "code")
    private String code;

    /**
     * 名称
     */
    @TableField(value = "name")
    private String name;

    /**
     * 类型
     */
    @TableField(value = "type")
    private String type;

    /**
     * 连接地址
     */
    @TableField(value = "url")
    private String url;

    /**
     * 登录用户
     */
    @TableField(value = "username")
    private String username;

    /**
     * 登录密码
     */
    @TableField(value = "password")
    private String password;

    /**
     * 加密密码
     */
    @TableField(value = "encode")
    private Integer encode;

    /**
     * 顺序
     */
    @TableField(value = "sort")
    private BigDecimal sort;

    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;

    /**
     * 是否删除
     */
    @TableLogic
    @TableField(value = "deleted")
    private Long deleted;

    /**
     * 是否启用
     */
    @TableField(value = "enabled")
    private Boolean enabled;

    /**
     * 启用者
     */
    @TableField(value = "enabled_by")
    private String enabledBy;

    /**
     * 启用时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "enabled_time")
    private Date enabledTime;

}